home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / IntlResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  12.5 KB  |  356 lines  |  [TEXT/MMCC]

  1. /*
  2.      File:        IntlResources.h
  3.  
  4.      Contains:    International Resource definitions.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __INTLRESOURCES__
  21. #define __INTLRESOURCES__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT_SUPPORTED
  38. #pragma import on
  39. #endif
  40.  
  41.  
  42. enum {
  43. /* Bits in the itlcFlags byte */
  44.     itlcShowIcon                = 7,                            /*Show icon even if only one script*/
  45.     itlcDualCaret                = 6,                            /*Use dual caret for mixed direction text*/
  46. /* Bits in the itlcSysFlags word */
  47.     itlcSysDirection            = 15,                            /*System direction - left to right/right to left*/
  48. /* the NumberParts indices */
  49.     tokLeftQuote                = 1,
  50.     tokRightQuote                = 2,
  51.     tokLeadPlacer                = 3,
  52.     tokLeader                    = 4,
  53.     tokNonLeader                = 5,
  54.     tokZeroLead                    = 6,
  55.     tokPercent                    = 7,
  56.     tokPlusSign                    = 8,
  57.     tokMinusSign                = 9,
  58.     tokThousands                = 10,
  59.     tokSeparator                = 12,                            /*11 is a reserved field*/
  60.     tokEscape                    = 13,
  61.     tokDecPoint                    = 14,
  62.     tokEPlus                    = 15,
  63.     tokEMinus                    = 16,
  64.     tokMaxSymbols                = 31,
  65.     curNumberPartsVersion        = 1                                /*current version of NumberParts record*/
  66. };
  67.  
  68. enum {
  69.     currSymLead                    = 16,
  70.     currNegSym                    = 32,
  71.     currTrailingZ                = 64,
  72.     currLeadingZ                = 128
  73. };
  74.  
  75. enum {
  76.     mdy,
  77.     dmy,
  78.     ymd,
  79.     myd,
  80.     dym,
  81.     ydm
  82. };
  83.  
  84. typedef SInt8 DateOrders;
  85.  
  86.  
  87. enum {
  88.     timeCycle24                    = 0,                            /*time sequence 0:00 - 23:59*/
  89.     timeCycleZero                = 1,                            /*time sequence 0:00-11:59, 0:00 - 11:59*/
  90.     timeCycle12                    = 255,                            /*time sequence 12:00 - 11:59, 12:00 - 11:59*/
  91.     zeroCycle                    = 1,                            /*old name for timeCycleZero*/
  92.     longDay                        = 0,                            /*day of the month*/
  93.     longWeek                    = 1,                            /*day of the week*/
  94.     longMonth                    = 2,                            /*month of the year*/
  95.     longYear                    = 3,                            /*year*/
  96.     supDay                        = 1,                            /*suppress day of month*/
  97.     supWeek                        = 2,                            /*suppress day of week*/
  98.     supMonth                    = 4,                            /*suppress month*/
  99.     supYear                        = 8,                            /*suppress year*/
  100.     dayLdingZ                    = 32,
  101.     mntLdingZ                    = 64,
  102.     century                        = 128,
  103.     secLeadingZ                    = 32,
  104.     minLeadingZ                    = 64,
  105.     hrLeadingZ                    = 128
  106. };
  107.  
  108. /* move OffsetTable to QuickdrawText */
  109. struct Intl0Rec {
  110.     char                            decimalPt;                    /*decimal point character*/
  111.     char                            thousSep;                    /*thousands separator character*/
  112.     char                            listSep;                    /*list separator character*/
  113.     char                            currSym1;                    /*currency symbol*/
  114.     char                            currSym2;
  115.     char                            currSym3;
  116.     UInt8                            currFmt;                    /*currency format flags*/
  117.     UInt8                            dateOrder;                    /*order of short date elements: mdy, dmy, etc.*/
  118.     UInt8                            shrtDateFmt;                /*format flags for each short date element*/
  119.     char                            dateSep;                    /*date separator character*/
  120.     UInt8                            timeCycle;                    /*specifies time cycle: 0..23, 1..12, or 0..11*/
  121.     UInt8                            timeFmt;                    /*format flags for each time element*/
  122.     char                            mornStr[4];                    /*trailing string for AM if 12-hour cycle*/
  123.     char                            eveStr[4];                    /*trailing string for PM if 12-hour cycle*/
  124.     char                            timeSep;                    /*time separator character*/
  125.     char                            time1Suff;                    /*trailing string for AM if 24-hour cycle*/
  126.     char                            time2Suff;
  127.     char                            time3Suff;
  128.     char                            time4Suff;
  129.     char                            time5Suff;                    /*trailing string for PM if 24-hour cycle*/
  130.     char                            time6Suff;
  131.     char                            time7Suff;
  132.     char                            time8Suff;
  133.     UInt8                            metricSys;                    /*255 if metric, 0 if inches etc.*/
  134.     short                            intl0Vers;                    /*region code (hi byte) and version (lo byte)*/
  135. };
  136. typedef struct Intl0Rec Intl0Rec;
  137.  
  138. typedef Intl0Rec *Intl0Ptr, **Intl0Hndl;
  139.  
  140. struct Intl1Rec {
  141.     Str15                            days[7];                    /*day names*/
  142.     Str15                            months[12];                    /*month names*/
  143.     UInt8                            suppressDay;                /*255 for no day, or flags to suppress any element*/
  144.     UInt8                            lngDateFmt;                    /*order of long date elements*/
  145.     UInt8                            dayLeading0;                /*255 for leading 0 in day number*/
  146.     UInt8                            abbrLen;                    /*length for abbreviating names*/
  147.     char                            st0[4];                        /*separator strings for long date format*/
  148.     char                            st1[4];
  149.     char                            st2[4];
  150.     char                            st3[4];
  151.     char                            st4[4];
  152.     short                            intl1Vers;                    /*region code (hi byte) and version (lo byte)*/
  153.     short                            localRtn[1];                /*now a flag for opt extension*/
  154. };
  155. typedef struct Intl1Rec Intl1Rec;
  156.  
  157. typedef Intl1Rec *Intl1Ptr, **Intl1Hndl;
  158.  
  159. /*fields for optional itl1 extension*/
  160. struct Itl1ExtRec {
  161.     Intl1Rec                        base;                        /*un-extended Intl1Rec*/
  162.     short                            version;
  163.     short                            format;
  164.     short                            calendarCode;                /*calendar code for this itl1 resource*/
  165.     long                            extraDaysTableOffset;        /*offset in itl1 to extra days table*/
  166.     long                            extraDaysTableLength;        /*length of extra days table*/
  167.     long                            extraMonthsTableOffset;        /*offset in itl1 to extra months table*/
  168.     long                            extraMonthsTableLength;        /*length of extra months table*/
  169.     long                            abbrevDaysTableOffset;        /*offset in itl1 to abbrev days table*/
  170.     long                            abbrevDaysTableLength;        /*length of abbrev days table*/
  171.     long                            abbrevMonthsTableOffset;    /*offset in itl1 to abbrev months table*/
  172.     long                            abbrevMonthsTableLength;    /*length of abbrev months table*/
  173.     long                            extraSepsTableOffset;        /*offset in itl1 to extra seps table*/
  174.     long                            extraSepsTableLength;        /*length of extra seps table*/
  175.     short                            tables[1];                    /*now a flag for opt extension*/
  176. };
  177. typedef struct Itl1ExtRec Itl1ExtRec;
  178.  
  179. struct UntokenTable {
  180.     short                            len;
  181.     short                            lastToken;
  182.     short                            index[256];                    /*index table; last = lastToken*/
  183. };
  184. typedef struct UntokenTable UntokenTable;
  185.  
  186. typedef UntokenTable *UntokenTablePtr, **UntokenTableHandle;
  187.  
  188. union WideChar {
  189.     char                            a[2];                        /*0 is the high order character*/
  190.     short                            b;
  191. };
  192. typedef union WideChar WideChar;
  193.  
  194. struct WideCharArr {
  195.     short                            size;
  196.     WideChar                        data[10];
  197. };
  198. typedef struct WideCharArr WideCharArr;
  199.  
  200. struct NumberParts {
  201.     short                            version;
  202.     WideChar                        data[31];                    /*index by [tokLeftQuote..tokMaxSymbols]*/
  203.     WideCharArr                        pePlus;
  204.     WideCharArr                        peMinus;
  205.     WideCharArr                        peMinusPlus;
  206.     WideCharArr                        altNumTable;
  207.     char                            reserved[20];
  208. };
  209. typedef struct NumberParts NumberParts;
  210.  
  211. typedef NumberParts *NumberPartsPtr;
  212.  
  213. struct Itl4Rec {
  214.     short                            flags;                        /*reserved*/
  215.     long                            resourceType;                /*contains 'itl4'*/
  216.     short                            resourceNum;                /*resource ID*/
  217.     short                            version;                    /*version number*/
  218.     long                            resHeader1;                    /*reserved*/
  219.     long                            resHeader2;                    /*reserved*/
  220.     short                            numTables;                    /*number of tables, one-based*/
  221.     long                            mapOffset;                    /*offset to table that maps byte to token*/
  222.     long                            strOffset;                    /*offset to routine that copies canonical string*/
  223.     long                            fetchOffset;                /*offset to routine that gets next byte of character*/
  224.     long                            unTokenOffset;                /*offset to table that maps token to canonical string*/
  225.     long                            defPartsOffset;                /*offset to default number parts table*/
  226.     long                            resOffset6;                    /*reserved*/
  227.     long                            resOffset7;                    /*reserved*/
  228.     long                            resOffset8;                    /*reserved*/
  229. };
  230. typedef struct Itl4Rec Itl4Rec;
  231.  
  232. typedef Itl4Rec *Itl4Ptr, **Itl4Handle;
  233.  
  234. /* New NItl4Rec for System 7.0: */
  235. struct NItl4Rec {
  236.     short                            flags;                        /*reserved*/
  237.     long                            resourceType;                /*contains 'itl4'*/
  238.     short                            resourceNum;                /*resource ID*/
  239.     short                            version;                    /*version number*/
  240.     short                            format;                        /*format code*/
  241.     short                            resHeader;                    /*reserved*/
  242.     long                            resHeader2;                    /*reserved*/
  243.     short                            numTables;                    /*number of tables, one-based*/
  244.     long                            mapOffset;                    /*offset to table that maps byte to token*/
  245.     long                            strOffset;                    /*offset to routine that copies canonical string*/
  246.     long                            fetchOffset;                /*offset to routine that gets next byte of character*/
  247.     long                            unTokenOffset;                /*offset to table that maps token to canonical string*/
  248.     long                            defPartsOffset;                /*offset to default number parts table*/
  249.     long                            whtSpListOffset;            /*offset to white space code list*/
  250.     long                            resOffset7;                    /*reserved*/
  251.     long                            resOffset8;                    /*reserved*/
  252.     short                            resLength1;                    /*reserved*/
  253.     short                            resLength2;                    /*reserved*/
  254.     short                            resLength3;                    /*reserved*/
  255.     short                            unTokenLength;                /*length of untoken table*/
  256.     short                            defPartsLength;                /*length of default number parts table*/
  257.     short                            whtSpListLength;            /*length of white space code list*/
  258.     short                            resLength7;                    /*reserved*/
  259.     short                            resLength8;                    /*reserved*/
  260. };
  261. typedef struct NItl4Rec NItl4Rec;
  262.  
  263. typedef NItl4Rec *NItl4Ptr, **NItl4Handle;
  264.  
  265. struct TableDirectoryRecord {
  266.     OSType                            tableSignature;                /*4 byte long table name */
  267.     unsigned long                    reserved;                    /*Reserved for internal use */
  268.     unsigned long                    tableStartOffset;            /*Table start offset in byte*/
  269.     unsigned long                    tableSize;                    /*Table size in byte*/
  270. };
  271. typedef struct TableDirectoryRecord TableDirectoryRecord;
  272.  
  273. struct Itl5Record {
  274.     Fixed                            versionNumber;                /*itl5 resource version number */
  275.     unsigned short                    numberOfTables;                /*Number of tables it contains */
  276.     unsigned short                    reserved[3];                /*Reserved for internal use */
  277.     TableDirectoryRecord            tableDirectory[1];            /*Table directory records */
  278. };
  279. typedef struct Itl5Record Itl5Record;
  280.  
  281. struct RuleBasedTrslRecord {
  282.     short                            sourceType;                    /*Transliterate target type for the LHS of the rule */
  283.     short                            targetType;                    /*Transliterate target type for the RHS of the rule */
  284.     short                            formatNumber;                /*Transliterate resource format number */
  285.     short                            propertyFlag;                /*Transliterate property flags */
  286.     short                            numberOfRules;                /*Number of rules following this field */
  287. };
  288. typedef struct RuleBasedTrslRecord RuleBasedTrslRecord;
  289.  
  290. struct ItlcRecord {
  291.     short                            itlcSystem;                    /*default system script*/
  292.     short                            itlcReserved;                /*reserved*/
  293.     SInt8                            itlcFontForce;                /*default font force flag*/
  294.     SInt8                            itlcIntlForce;                /*default intl force flag*/
  295.     SInt8                            itlcOldKybd;                /*MacPlus intl keybd flag*/
  296.     SInt8                            itlcFlags;                    /*general flags*/
  297.     short                            itlcIconOffset;                /*keyboard icon offset; not used in 7.0*/
  298.     SInt8                            itlcIconSide;                /*keyboard icon side; not used in 7.0*/
  299.     SInt8                            itlcIconRsvd;                /*rsvd for other icon info*/
  300.     short                            itlcRegionCode;                /*preferred verXxx code*/
  301.     short                            itlcSysFlags;                /*flags for setting system globals*/
  302.     SInt8                            itlcReserved4[32];            /*for future use*/
  303. };
  304. typedef struct ItlcRecord ItlcRecord;
  305.  
  306. struct ItlbRecord {
  307.     short                            itlbNumber;                    /*itl0 id number*/
  308.     short                            itlbDate;                    /*itl1 id number*/
  309.     short                            itlbSort;                    /*itl2 id number*/
  310.     short                            itlbFlags;                    /*Script flags*/
  311.     short                            itlbToken;                    /*itl4 id number*/
  312.     short                            itlbEncoding;                /*itl5 ID # (optional; char encoding)*/
  313.     short                            itlbLang;                    /*current language for script */
  314.     SInt8                            itlbNumRep;                    /*number representation code*/
  315.     SInt8                            itlbDateRep;                /*date representation code */
  316.     short                            itlbKeys;                    /*KCHR id number*/
  317.     short                            itlbIcon;                    /*ID # of SICN or kcs#/kcs4/kcs8 suite.*/
  318. };
  319. typedef struct ItlbRecord ItlbRecord;
  320.  
  321. /* New ItlbExtRecord structure for System 7.0 */
  322. struct ItlbExtRecord {
  323.     ItlbRecord                        base;                        /*un-extended ItlbRecord*/
  324.     long                            itlbLocalSize;                /*size of script's local record*/
  325.     short                            itlbMonoFond;                /*default monospace FOND ID*/
  326.     short                            itlbMonoSize;                /*default monospace font size*/
  327.     short                            itlbPrefFond;                /*preferred FOND ID*/
  328.     short                            itlbPrefSize;                /*preferred font size*/
  329.     short                            itlbSmallFond;                /*default small FOND ID*/
  330.     short                            itlbSmallSize;                /*default small font size*/
  331.     short                            itlbSysFond;                /*default system FOND ID*/
  332.     short                            itlbSysSize;                /*default system font size*/
  333.     short                            itlbAppFond;                /*default application FOND ID*/
  334.     short                            itlbAppSize;                /*default application font size*/
  335.     short                            itlbHelpFond;                /*default Help Mgr FOND ID*/
  336.     short                            itlbHelpSize;                /*default Help Mgr font size*/
  337.     Style                            itlbValidStyles;            /*set of valid styles for script*/
  338.     Style                            itlbAliasStyle;                /*style (set) to mark aliases*/
  339. };
  340. typedef struct ItlbExtRecord ItlbExtRecord;
  341.  
  342.  
  343. #if PRAGMA_IMPORT_SUPPORTED
  344. #pragma import off
  345. #endif
  346.  
  347. #if PRAGMA_ALIGN_SUPPORTED
  348. #pragma options align=reset
  349. #endif
  350.  
  351. #ifdef __cplusplus
  352. }
  353. #endif
  354.  
  355. #endif /* __INTLRESOURCES__ */
  356.